<template>
	<view>
		<view class="list">
			<view class="listItem flex-between" >
				<view class="item flex-center">
					状态
				</view>
				<view class="item flex-center">
					备注
				</view>
				<view class="item flex-center">
					申请时间
				</view>
			</view>
			
			<view class="listItem flex-between" v-for="item in list" :key="item.id">
        
        <view :class="[item.status == -1 ? 'item flex-center colorRed' : 'item flex-center colorPurple']" >
        	{{ item.status == -1 ? "拒绝申请" : item.status == 0 ? "申请中" :  item.status == 1 ? "已认证" : ""}}
        </view>
        
        <view :class="[item.status == -1 ? 'item flex-center colorRed' : 'item flex-center colorPurple']">
        	{{ item.reason }}
        </view>
        
        
				<view class="item flex-center">
					{{ item.createdAt }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: "",
				from: "",
				list: [],
			}
		},
		onLoad(option) {
			this.type = option.type;
			this.from = option.from;
			if(option.from == "申请服务中心") {
				uni.setNavigationBarTitle({
					title: "服务中心申请记录"
				})
			} else {
				uni.setNavigationBarTitle({
					title: "运营中心申请记录"
				})
			}
			this.getList();
		},
	
		
		methods:{
			getList() {
				this.$post({
					module: 'User',
					interface: 3004,
					data: {
						type: this.type,
						},
				}).then(res => {
					// console.log("申请记录",res);
					this.list = res;
				})
			},
		},
	}
</script>

<style scoped lang="scss">
	.list {
		margin-top: 40rpx;
		padding: 0 32rpx;
		.listItem {
			margin-bottom: 32rpx;
			.item {
				flex: 1;
				font-size: 28rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #000000;
				line-height: 40rpx;
				word-break: break-all;
			}
			.colorRed {
				color: #FE2E1C;
			}
			.colorPurple {
				color: #F2615F;
			}
		}
	}
</style>